package com.acmetelecom.utils;

import org.joda.time.DateTime;
import org.junit.Test;

import static com.acmetelecom.call.CallEventBuilder.asDateTime;
import static org.junit.Assert.*;

public class TimeParserTest {
	@Test
	public void testTimeParsing() {
		assertTrue(asDateTime("1/1/70 6:50pm").equals(asDateTime("1/1/70 6:50pm")));
	}
	
	@Test
	public void testDifferences() {
		DateTime start = asDateTime("1/1/70 6:50pm");
		DateTime end = asDateTime("1/1/70 7:20pm");
		
		assertTrue( ((end.getMillis() - start.getMillis()) / 1000) == 1800 );
	}
}
